package model;

import common.GridCoordinate;

/**
 * @author Colin
 *
 *Abstract class Item encompasses all items that can be placed
 *on the map and upgrades that can be applied. All items have
 *an associated name, and cost.
 */
public abstract class Item {
	
	private String name;
	private String imageName;
	private int cost;
	private int rotation;
	
	public Item(String name, String imageName, int cost ){
		this.imageName = imageName;
		this.name = name;
		this.cost = cost;
		this.setRotation(0);
	}
	
	/**
	 * Returns a description of the item. All subclasses must implement.
	 * @return
	 */
	public abstract String getDescription();
	
	/**
	 * Returns a description of how to buy and use the item
	 */
	public abstract String getUsageDescription();
	
	public boolean canBuy(int curPoints) {
		if(curPoints >= cost)
			return true;
		else 
			return false;
	}
	
	public String getImageName(){
		return imageName;
	}
	
	public int getCost(){
		return cost;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public abstract GridCoordinate getPosition();

	public void setRotation(int rotation) {
		this.rotation = rotation;
	}

	public int getRotation() {
		return rotation;
	}
}
